package com.yanxin.credit.dto;

import com.github.pagehelper.PageInfo;

import java.io.Serializable;
import java.util.List;

/**
 * 分页封装数据
 */
public class PageDataInfo implements Serializable {

    /**
     * 总记录数
     */
    private long total;

    private long currentPage;

    /**
     * 列表数据
     */
    private List<?> rows;

    /**
     * 分页
     *
     * @param rows 列表数据
     */
    public PageDataInfo(List<?> rows) {
        PageInfo pageInfo = new PageInfo(rows);
        this.rows = rows;
        this.total = pageInfo.getTotal();
        this.currentPage = pageInfo.getPageNum();
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public long getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(long currentPage) {
        this.currentPage = currentPage;
    }

    public List<?> getRows() {
        return rows;
    }

    public void setRows(List<?> rows) {
        this.rows = rows;
    }
}
